package cn.yto.print.model.response;

import cn.yto.print.enums.ResponseCodeEnum;
import lombok.Data;

import java.util.List;
import java.util.Map;

@Data
public class PrintTaskResponse {

    private String code;
    private String msg;
    private String status;
    private String sessionId;

    private String cmd;
    private String taskId;
    private String printer;
    private List<String> success;
    private List<PrintStatus> printStatus;
    /* 总面单数+“-”+成功面单数 */
    private String total;
    private String templateType;

    /** 打印机列表 */
    private List<Map<String, String>> printers;
    private List<String> pluginConnectionSuccess;
    private List<String> pluginConnectionError;
    private String version;

    @Data
    public static class PrintStatus {
        private String status;
        private String documentID;
        private String msg;
        private String detail;

    }

    public void setCommProperty(ResponseCodeEnum responseCode) {
        this.code = responseCode.getCode();
        this.msg = responseCode.getDesc();
        this.status = responseCode.getStatus();
    }

    public void setCodeProperty(ResponseCodeEnum responseCode) {
        this.code = responseCode.getCode();
        this.status = responseCode.getStatus();
    }

}
